Skip to content

Add PUT /users/:id endpoint (#1) - #74

Open
lehmoja wants to merge 3 commits into
mate-academy:mainfrom
lehmoja:main
Open

Add PUT /users/:id endpoint (#1)#74
lehmoja wants to merge 3 commits into
mate-academy:mainfrom
lehmoja:main

Conversation

@lehmoja

@lehmoja lehmoja commented Aug 8, 2026

Copy link
Copy Markdown
  • Add updateUser helper to the store

Adds an updateUser(id, {name, email}) function to db/store.js so routes can update a user's fields, following the same pattern as createUser. Returns undefined for an unknown id so callers can branch on a falsy result, same as getUserById.

  • Add PUT /users/:id endpoint

Adds the update-a-user route: validates that name and email are present (400 otherwise), looks up and updates via
store.updateUser, and returns 404 when the id doesn't match an existing user. Turns tests/update-user.test.js green.

  • Add NOTES.md

Documents the approved plan, the model used, why the commits were split the way they were, and what self-review caught before opening the PR.


lehmoja and others added 3 commits August 8, 2026 15:03
* Add updateUser helper to the store

Adds an updateUser(id, {name, email}) function to db/store.js so
routes can update a user's fields, following the same pattern as
createUser. Returns undefined for an unknown id so callers can
branch on a falsy result, same as getUserById.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Add PUT /users/:id endpoint

Adds the update-a-user route: validates that name and email are
present (400 otherwise), looks up and updates via
store.updateUser, and returns 404 when the id doesn't match an
existing user. Turns tests/update-user.test.js green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Add NOTES.md

Documents the approved plan, the model used, why the commits were
split the way they were, and what self-review caught before
opening the PR.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Adds Prettier (2-space indent) since the repo had no dedicated
formatter, and wires a Claude Code hook to run it after every
Write/Edit tool call.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011CZ5XFpPxJDvRTgKERHPuQ
Denies any Bash command invoking npm publish, including chained
and npx-wrapped forms. Moved the matching logic into a script
(.claude/hooks/block-npm-publish.sh) that strips heredoc bodies
before matching, so prose that happens to mention "npm publish"
(e.g. inside a git commit message) isn't mistaken for a real
invocation and blocked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011CZ5XFpPxJDvRTgKERHPuQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant